<template>
    <div class="hello">
      <h1>{{ parentMessage }}</h1>
      <h1>{{ varMessage }}</h1>
    </div>
  </template>
  
  <script setup>
import { defineProps ,defineEmits,onMounted} from 'vue';
const props=defineProps({
    parentMessage:String,
    varMessage:String
})
const emit=defineEmits(['getMessage'])
const sendMes=(()=>{
  emit("getMessage","这是子传递给父亲的值")
})
onMounted(()=>{
  console.log(props.parentMessage,props.varMessage)
  sendMes()
})

  </script>
  
  <!-- Add "scoped" attribute to limit CSS to this component only -->
  